package message.visitor;

import message.Message;
import message.types.data.AddDataRequest;
import message.types.data.GetAllDatasAnswer;
import message.types.data.GetLastDataAnswer;
import message.types.message.RejectedRequest;
import message.types.none.GetAllDatasRequest;
import message.types.none.GetLastDataRequest;
import message.types.none.NewDataNotification;
import message.types.stalker.CreateRoomSuccessAnswer;
import message.types.stalker.LogOffNotification;
import message.types.stalker.LoginSuccessAnswer;
import message.types.stalker.RegisterRequest;
import message.types.stalkerstring.GetRoomFromNameAnswer;
import message.types.stalkerstring.GetUserFromNameAnswer;
import message.types.string.CreatePrivatePersistentRoomRequest;
import message.types.string.CreateRoomRequest;
import message.types.string.GetRoomFromNameRequest;
import message.types.string.GetUserFromNameRequest;
import message.types.string.LoginRequest;
import message.types.stringstring.LoginFailedAnswer;
import message.types.unique.EmptyMessage;
import message.types.unique.RoomInvitation;


/**
 * Visitor for request class
 */

public abstract class MessageVisitor<T> {
  
  /**
   * Relays a message to its destination
   * @requires message not null
   * @param message message to be relayed
   */
  protected void relayMessage(Message message) {
    assert message != null;
    message.getDestination().acceptMessage(message);
  }
  
  /**
   * Rejects a message
   */
  protected Message getRejectedMessage(Message message) {
    assert message != null;
    return new RejectedRequest(message.getDestination(),
                               message.getClient(),
                               message);
  }
  
  public T visit(AddDataRequest add_data_req) {
    assert false;
    return null;
  }
  
  public T visit(GetLastDataRequest get_last_req) {
    assert false;
    return null;
  }
  
  public T visit(GetLastDataAnswer get_last_ans) {
    assert false;
    return null;
  }
  
  public T visit(RegisterRequest get_register_req) {
    assert false;
    return null;
  }
  
  public T visit(EmptyMessage get_empty_msg) {
    assert false;
    return null;
  }
  
  public T visit(LoginSuccessAnswer get_login_success_ans) {
    assert false;
    return null;
  }
  
  public T visit(LoginRequest get_login_req) {
    assert false;
    return null;
  }
  
  public T visit(CreateRoomRequest create_room_req) {
    assert false;
    return null;
  } 
  
  public T visit(CreatePrivatePersistentRoomRequest create_room_req) {
    assert false;
    return null;
  } 
  
  public T visit(CreateRoomSuccessAnswer create_room_req) {
    assert false;
    return null;
  }
  
  public T visit(RoomInvitation room_invit) {
    assert false;
    return null;
  }
  
  public T visit(GetAllDatasRequest get_all_data) {
    assert false;
    return null;
  }
  
  public T visit(GetAllDatasAnswer get_all_ans) {
    assert false;
    return null;
  }
  
  public T visit(GetUserFromNameRequest get_stalker_from_name) {
    assert false;
    return null;
  }
  
  public T visit(GetUserFromNameAnswer get_stalker_from_name) {
    assert false;
    return null;
  }
  
  public T visit(LoginFailedAnswer login_faile) {
    assert false;
    return null;
  }
  
  public T visit(NewDataNotification new_data_notif) {
    assert false;
    return null;
  }
  
  public T visit(LogOffNotification log_off_notif) {
    assert false;
    return null;
  }
  
  public T visit(GetRoomFromNameRequest get_stalker_from_name) {
    assert false;
    return null;
  }
  
  public T visit(GetRoomFromNameAnswer get_stalker_from_name) {
    assert false;
    return null;
  }
  
  public T visit(RejectedRequest rejected_request) {
    assert false;
    return null;
  }
  
}
